Auto-tuning controller using loop-shaping

ABSTRACT

A method and apparatus for automatically adjusting the gains of a feedback controller while the process continues to run and the controller continues to operate and control the process is disclosed. A desired closed-loop control bandwidth and a target loop transfer function are specified by the operator, and the tuning is accomplished automatically with minimal operator intervention and without the need for developing a model of the process. The automatic tuner subjects the process to one or more disturbance and the operation of both the process and the controller are monitored.

FIELD OF THE INVENTION

[0001] This invention generally relates to a method and apparatus forcontrolling the operation of a process. More specifically, thisinvention provides a method and apparatus for automatically adjustingthe gains of a proportional-integral-derivative controller while thecontroller continues to control the process.

BACKGROUND OF THE INVENTION

[0002] A simple proportional-integral-derivative (PID) feedbackcontroller is the most popular apparatus used in the industry forcontrolling the operation and performance of a process. A feedbackcontroller is also known as a closed-loop controller.

[0003] Systems used for operating plants and monitoring the operation ofone or more processes within such plants typically include severalfeedback (or closed-loop) PID controllers, hereinafter referred to asPID controller or simply controller, as standard “equipment” withassumed default values for the PID gains. In order for these plants, andprocesses therein, to operate correctly and robustly, each of the PIDgains of the controller must be adequately and appropriately tuned forthe application at hand. When the “best” PID gains are used, thecontroller will quickly react to overcome and compensate for anyinternally and/or externally induced disturbances to which the processis subjected. Examples of disturbances are: change in control set point,change in process characteristics, sensor noise and uncertainty, etc.However, determining the appropriate PID gains is a challenging task forengineers and plant operators because some level of user expertise isnecessary for successfully establishing the “best” gains.

[0004] Several tools, methods, and theories are available for tuning PIDcontroller gains (for example, Astrom and Hagglund, PID Controllers:Theory, Design, and Tuning, 2nd ed., ISA, 1995). However, in practicethe bulk of these methods require a lot of engineering effort to getsatisfactory results. Currently, control engineers use commerciallyavailable tools only as a starting point, and then “play” with the PIDgains to get acceptable results. This is a very time consuming effort.Therefore, the notion of an auto-tuning or a self-tuning PID controllerfor determining PID gains with minimal operator interaction is highlydesirable. This concept has tremendous commercial value, and there are anumber of automatic gain tuners in the market. In some automatic gaintuners, the controller PID gains are derived analytically based on alow-order model of the process. In other methods, the tuning is based onthe optimization of some performance measure of the controller asrelated to the characteristics of the frequency and/or time response ofthe process. Persons skilled in the art will recognize that currentauto-tuning techniques require frequent adjustment of the PID gains, areunreliable, and are not particularly effective (Shinskey, FeedbackControllers for the Process Industries, McGraw Hill, 1994). Yet, thetuning of PID gains remains a subject of great practical interestbecause of the large number of PID controllers in existence, e.g., atypical refinery could have as many as 3,000 PID controllers.

[0005] In view of the foregoing, it is desirable to provide an improvedmethod for tuning the controller gains. It is preferable for the gaintuner to require minimal operator interaction and for the tuning to beaccomplished without the need for models of the process and/or thecontroller. It is further desirable to tune the PID controller gainswhile the controller continues to control the process.

SUMMARY OF THE INVENTION

[0006] The preferred embodiment of this invention includes a method andapparatus for tuning a PID controller such that the individual PID gainsare adjusted while the process is underway, and thus without the needfor developing a representative model of the process. A desiredclosed-loop control bandwidth and a target loop transfer function arespecified by the operator, and the tuning is preferably accomplishedautomatically with no additional operator intervention. The desiredclosed-loop control bandwidth is preferably indicative of the preferredsettling time or the time constant of the process in response to adisturbance, and the target loop transfer function is the targeted ordesired Laplace transfer function representative of the overall systemor loop typically including the controlled process, the processcontroller, sensors, actuators, etc., and thus indicative of the desiredresponse of the process (e.g., first-order response, second-orderresponse, etc.). The automatic PID gain tuner subjects the process toone or more disturbance and the operation of both the process and thecontroller are monitored. In the preferred embodiment, the PID gains areestimated by using recursive least squares curve fitting techniques.

BRIEF DESCRIPTION OF THE DRAWINGS

[0007]FIG. 1 is a block diagram of an automatic PID gain tuner, aprocess controller, and a process; and

[0008]FIG. 2 is a more detailed block diagram of an illustrativeembodiment of the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0009]FIG. 1 is an illustrative block diagram of the invention showingthe signal flows between PID controller 12, controlled process 30, andPID gain tuner 36. Controller 12 receives the process set point on path10, and signal 16 indicative of the process output 14. Controller outputon path 20 is adjusted by controller 12 to maintain process output onpath 14 as close as possible to the process set point on path 10. Undernormal operation, i.e., when PID gain tuning is not underway, and whenthe difference between process output 14 and process set point 10 isnegligible and it is not necessary to change the controller's PID gains,controller output 20 is relayed as the process input control signal 26for adjusting the operation of process 30.

[0010] PID gain tuner 36 is used for monitoring the performance ofcontroller 12 and process 30 such that new PID gains can be determinedautomatically when initiated by an operator, upon reaching some a prioriset conditions such as slow responding or un-responding process output14 to changes in controller output 20, at a predetermined interval, etc.When PID gain tuning is initiated, a desired closed-loop controlbandwidth on path 34 and a target loop transfer function on path 32 areeither entered by an operator or pre-specified values are used. Thedesired closed-loop control bandwidth is preferably indicative of thepreferred settling time or the time constant of the process in responseto a disturbance, and the target loop transfer function is the targetedor desired Laplace transfer function representative of the overallsystem or loop typically including the controlled process, the processcontroller, sensors, actuators, etc., and thus indicative of the desiredresponse of the process (e.g., first-order response, second-orderresponse, etc.).

[0011] A disturbance signal is introduced on path 24 by PID gain tuner36 to process 30 by perturbing the controller output on path 20 suchthat the process input control signal on path 26 is different from thatnecessary for maintaining process output 14 at process set point 10. PIDgain tuner 36 monitors the controller's proportional error, integralerror, and derivative error, provided on path 18, the controller output20 on path 22, and the process input control signal 26 on path 28. In anillustrative embodiment, new values for the controller PID gains arethen recursively computed by the PID gain tuner 36, and transmitted onpath 38 to controller 12. The PID gains in controller 12 are thenreplaced by the new gains provided on path 38. In some embodiments, PIDgain tuner 36 continues monitoring the performance of controller 12 andprocess 30, and automatically continues to adjust the PID gains untilgain tuning is terminated by the operator and/or some a priori setconditions are satisfied.

[0012] In FIG. 2, the individual functional blocks have internal labelsdescribing the individual functions which each represent. Establishedconventions are followed in FIG. 2 to represent the various functions ofthe invention. Circles to which are supplied two or more signals imply asum or difference calculation as indicated by the adjacent plus or minussigns. Thus, the plus and minus signs adjacent the junctions of paths 10and 16, respectively, at summation element 2 implies subtraction of thevalue encoded in the signal on path 16 from the value encoded on path 10to form an error e transmitted on path 4. Each rectangular block, sayblock 60, represents some type of mathematical or computationaloperation on the values encoded in the signals supplied to that block.Thus, the signal on path 4, which encodes the error e, is supplied tofunctional block 60, to collectively represent an apparatus whichperforms a Laplace transform operation on the error e. Other functionalblocks represent decision operations, calculation of other mathematicalfunctions, such as multiplication, and other operations of varioustypes.

[0013] Referring now to FIG. 2, element 2 of controller K in block 12subtracts the process output y 14 received on path 16 from the set pointr on path 10 to form the error e on path 4. The error e on path 4 issequentially operated on by blocks 50 and 52 to form a proportionalerror which is transmitted on path 54 to summation element 6 and whichis also transmitted on path 56 to the PID gain tuner 36. Block 50performs the function of multiplying the error e with the numeric valueshown in block 50, said numeric value typically being 1.0, and block 52performs the function of multiplying the signal from block 50 with theproportional gain value designated as K_(p) in block 52. Similarly, theerror e on path 4 is sequentially operated on by blocks 60 and 62 toform an integral error which is transmitted on path 64 to summationelement 6 and which is also transmitted on path 66 to the PID gain tuner36. Block 60 performs an integration Laplace transformation on the errore input on path 4, and block 62 multiplies the signal from block 60 withthe integral gain value designated as K_(i) in block 62. Additionally,the error e on path 4 is sequentially operated on by blocks 70 and 72 toform a derivative error which is transmitted on path 74 to summationelement 6 and which is also transmitted on path 76 to the PID gain tuner36. Block 70 performs a derivative Laplace transformation on the error einput on path 4, and block 72 performs the function of multiplying thesignal from block 70 with the derivative gain value designated as K_(d)in block 72. Summation element 6 of controller 12 adds the proportional,integral, and derivative errors received on paths 54, 64, and 74,respectively, to yield a controller output signal Ke. The controlleroutput Ke is transmitted on path 20 to summation element 8 and also onpath 22 to the PID gain tuner 36.

[0014] Under normal controller operation, i.e., when PID gain tuning isnot underway, PID gain tuner 36 remains inactive and controller outputKe received on path 20 by element 8 is transmitted without modificationas the process input control signal u on paths 26 and 28, respectively,to the controlled process 30 and the PID gain tuner 36. The controlledprocess represented in block 30 by the Laplace transfer function Gincludes a plurality of control elements controlled by controller 12.Controlled process 30 receives the process input control signal u onpath 26 and manipulates the operation of the control elements to matchthe process output y 14 to the process set point r 10. Typical examplesof control elements are valves, pumps, fans, etc.

[0015] The algorithms used in the PID gain tuner 36 for determining newPID gains for controller 12, as envisioned in the preferred embodimentof this invention will now be discussed in detail. The objective of afeedback controller is to maintain a system or process at a desiredoutput level in the presence of disturbances, uncertainty, systeminstability, measurement noise, etc. In such controllers, theclosed-loop transfer functions relating the error e on path 4 to theset-point r on path 10 are: $\begin{matrix}{e = {{\frac{1}{1 + {GK}}\left( {r - d_{0}} \right)} + {\frac{GK}{1 + {GK}}n} - {\frac{G1}{1 + {GK}}d_{i}}}} & {{Equation}\quad (1)}\end{matrix}$

 e=S(r−d _(o) −Gd ₁)+Tn  Equation (2)

[0016] where,

[0017] n is the measurement noise imposed on the process output y 14resulting from the characteristics of the sensors, transmitters,receivers, etc., used for measuring the process output 14,

[0018] d_(o) and d₁, are disturbances experienced by the controlledprocess 30,

[0019] G is the transfer function representative of the process 30 beingcontrolled,

[0020] K is the transfer function representative of the controller 12,

[0021] S=1/(1+GK) is a sensitivity function, and

[0022] T=GK/(1+GK) is a complimentary sensitivity function.

[0023] It is desirable to keep the error e on path 4 small whichtranslates to the minimization of both S and T. However, the controlsystem must also meet the fundamental constraint of S+T=1. Therefore, Sand T can not be made arbitrarily small at the same time. Realizing thatset points and disturbances are typically low frequency signals andmeasurement noise is a high frequency signal, satisfactory performancecan be achieved by making S small at low frequencies and T small at highfrequencies. Since both S and T depend on the transfer function of theoverall system which includes the controlled process, processcontroller, sensors, actuators, etc., a target loop transfer function Lis selected in block 32, and transmitted on path 33 to the PID gaintuner 36, such that the closed-loop transfer functions have desirableproperties. Loop-shaping is the classic frequency based control designmethodology that achieves this objective by shaping the open-looptransfer function,

L(jω)=G(jω)K(jω)  Equation (3)

[0024] This is done by choosing loop-shapes that have a large gain atlow frequencies below crossover and a small gain at high frequenciesabove crossover. The controller K, i.e., the PID gains of the controller12, is selected such that the loop transfer function GK approximates thetarget loop transfer function L specified in block 32.

[0025] As previously described, the target loop transfer function is thetargeted or desired Laplace transfer function representative of theoverall system or loop typically including the controlled process, theprocess controller, sensors, actuators, etc., and thus indicative of thedesired response of the process (e.g., first-order response,second-order response, etc.). The PID gain tuner 36 selects the targetloop-shape based on the desired closed-loop control bandwidth ω_(c)specified in block 34, and the nature of the process specified by theoperator as an input to block 32. For example, if the operator specifiesthe process to be stable in nature, then the PID gain tuner 36 willselect a first-order shape for the target loop transfer function(L=ω_(c)/s). Alternately, if the operator specifies the process ashaving an integration nature, then the PID gain tuner 36 will select asecond-order shape for the target loop transfer function,$\begin{matrix}\left( {L = \frac{\omega_{c}\left( {s + \frac{\omega_{c}}{x}} \right)}{s^{2}}} \right) & {{Equation}\quad (4)}\end{matrix}$

[0026] Here x is a parameter that governs the low-frequency slope orovershoot in response to a step change in the set point. Selection ofthe target loop transfer function L is governed by bandwidth constraintsimposed by uncertainty, non-minimum phase behavior and unstable poles.

[0027] As part of the tuning method, one or more system disturbanceu_(id) is generated by the PID gain tuner 36 and transmitted tosummation element 8 on path 24. It is important for the disturbancesignal u_(id) on path 24 to be plant friendly, i.e., a signal with whichthe operator is comfortable. The controller output Ke on path 20 and thedisturbance signal u_(id) on path 24 are arithmetically added bysummation element 8 and then transmitted on path 26 as the process inputcontrol signal u to the process 30. The disturbance signal u_(id) onpath 24 is selected to have power in the frequency region around thedesired closed-loop control bandwidth w_(c) specified in block 34 andtransmitted on path 35 to the PID gain tuner 36. As previouslydescribed, the desired closed-loop control bandwidth is preferablyindicative of the preferred settling time or the time constant of theprocess in response to any disturbance. The preferred settling time forthe process typically represents the desired or acceptable duration oftime within which the process output should reach stability after theprocess has been subjected to a disturbance such as a step change in thecontrol set point. As is well known in the art, the time constant of theprocess is the duration of time in which the process output has changedby approximately 66.7% in response to a disturbance such as a change inthe set point value. The closed-loop control bandwidth is limited by thenature of the system and uncertainty represented by the quality of thedata collected during testing. The tuning algorithm permits the operatorto adjust the desired closed-loop control bandwidth ω_(c) 34 to get adesirable loop with acceptable performance. An approximate range for thedesired closed-loop control bandwidth ω_(c) 34 can be obtained using apre-tuning step test.

[0028] In the preferred embodiment of this invention, the disturbancesignal u_(id) on path 24 includes one or more step changes. In analternate embodiment, the disturbance signal u_(id) on path 24 includesa pseudo random binary sequence. In another embodiment of thisinvention, the disturbance signal u_(id) on path 24 includes band-passfiltered noise. In yet another embodiment, the disturbance signal u_(id)on path 24 includes clipped white noise.

[0029] In the preferred embodiment of this invention, a recursive leastsquares algorithm is used to fit the PID gains to meet the followingobjective:

min∥u _(ID)(L−GK)/(1+GK)⁵∥₂   Equation (5)

[0030] which is equivalent to

min∥Lu+Ke∥ ₂  Equation (6)

[0031] Since G does not explicitly appear in this objective it allowsone to directly tune the PID controller gains without the need for amodel of the controlled process 30. In the preferred embodiment of thePID feedback controller of this invention, this is a solution to aleast-squares problem.

[0032] In the preferred embodiment of this invention, the auto-tuningPID controller is based on the loop-shaping concept described above. Theproportional gain K_(p), integral gain K_(i), and the derivative gainK_(d) are determined by directly fitting the loop transfer function to atarget loop-shape. Thus, the PID gains are automatically estimatedrecursively without identifying a model for the process 30 and/or thecontroller 12, and with minimal operator interaction.

[0033] Numerous advantages of the invention covered by this documenthave been set forth in the foregoing description. It will be understood,however, that this disclosure is, in many respects, only illustrative.Changes may be made in details, particularly in matters of shape, size,and arrangement of parts without exceeding the scope of the invention.The invention's scope is, of course, defined in the language in whichthe appended claims are expressed.

What is claimed is:
 1. A method for determining one or more new gainsfor a controller while the controller continues to control a processtowards a target loop transfer function, the controller receiving aprocess output signal and a process set point signal and providing aprocess input control signal, the method comprising the steps of:introducing a disturbance into the process input control signal;calculating one or more new gains for the controller using a controlleroutput signal, the process input control signal, and the target looptransfer function; and using the one or more new gains in the controllerto subsequently control the process.
 2. The method of claim 1, whereinthe one or more new gains for the controller are determined withoutusing a model of the process.
 3. The method of claim 1, wherein saidgains include a proportional gain.
 4. The method of claim 1, whereinsaid gains include an integral gain.
 5. The method of claim 1, whereinsaid gains include a derivative gain.
 6. The method of claim 1, whereinthe target loop transfer function is indicative of a desired response ofthe process.
 7. The method of claim 6, wherein the target loop transferfunction is a first-order transfer function.
 8. The method of claim 6,wherein the target loop transfer function is a second-order transferfunction.
 9. The method of claim 1, wherein the process is controlledwithin a desired closed-loop control bandwidth.
 10. The method of claim9, wherein the desired closed-loop control bandwidth is indicative of adesired settling time for the process.
 11. The method of claim 9,wherein the desired closed-loop control bandwidth is indicative of atime constant for the process.
 12. The method of claim 1, wherein thedisturbance includes one or more step changes.
 13. The method of claim1, wherein the disturbance includes a pseudo random binary sequence. 14.The method of claim 1, wherein the disturbance includes a white noisesignal that is band-pass filtered and clipped.
 15. The method of claim1, wherein the disturbance is introduced into the controller outputsignal causing a response in the process input control signal.
 16. Themethod of claim 1, wherein the controller uses the one or more new gainsto produce the controller output signal.
 17. The method of claim 16,wherein the controller output signal comprises a proportional error. 18.The method of claim 16, wherein the controller output signal comprisesan integral error.
 19. The method of claim 16, wherein the controlleroutput signal comprises a derivative error.
 20. The method of claim 1,wherein the process input control signal is the sum of the controlleroutput and the disturbance.
 21. The method of claim 1, wherein the newgains for the controller are calculated such that the sum total of thecontroller output and the product of the process input control signaland the target loop transfer function is minimized.
 22. The method ofclaim 21, wherein the sum total is minimized by curve fitting said sumtotal using recursive least squares technique.
 23. The method of claim21, wherein the sum total is minimized by curve fitting said sum totalusing recursive least squares technique with one or more constraint. 24.The method of claim 23, wherein the recursive least squares techniqueconstraint comprises positive values for the one or more new gains forthe controller.
 25. A tuning device for tuning one or more new gains ofa controller while the controller controls a process towards a targetloop transfer function, the controller receiving a process output signaland a process set point signal and providing a process input controlsignal, the gain tuning device comprising: disturbance generating meansfor generating a disturbance in the process input control signal;calculating means for calculating one or more new gains of thecontroller using a controller output signal, the process input controlsignal, and the target loop transfer function; and providing means forproviding the one or more new gains to the controller, whereby thecontroller uses the new gains to subsequently control the process.
 26. Amethod for determining one or more new gains for a controller while thecontroller continues to control a process towards a target loop transferfunction, the controller receiving a process output signal and a processset point signal and providing a controller output signal, the methodcomprising the steps of: introducing a disturbance into the controlleroutput signal causing a response in a process input control signal;calculating one or more new gains for the controller using thecontroller output signal, the response in the process input controlsignal, and the target loop transfer function; and using the one or morenew gains in the controller to subsequently control the process.
 27. Atuning device for tuning one or more new gains of a controller while thecontroller controls a process towards a target loop transfer function,the controller receiving a process output signal and a process set pointsignal and providing a controller output signal, the gain tuning devicecomprising: disturbance generating means for generating a disturbance inthe controller output signal causing a response in a process inputcontrol signal; calculating means for calculating one or more new gainsof the controller using the controller output signal, the response inthe process input control signal, and the target loop transfer function;and providing means for providing the one or more new gains to thecontroller, whereby the controller uses the new gains to subsequentlycontrol the process.